package com.xbongbong.saas.enums.business;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.enums.FieldTypeEnum;
import com.xbongbong.paas.enums.ScreenTypeEnum;
import com.xbongbong.saas.enums.SetTypeEnum;
import com.xbongbong.saas.enums.ShowTypeEnum;
import com.xbongbong.saas.enums.base.ContractBaseEnum;
import com.xbongbong.saas.enums.base.ContractStockBaseEnum;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

@Getter
public enum OrderOutStockEnum {
    // 出库单模板设计界面需要展示的字段
    // 基本信息
    BASE_INFO(ContractStockBaseEnum.BASE_INFO.getAttr(), "enum.orderOutstock.attrName.base_info", "baseInfo", FieldTypeEnum.SEPARATOR.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 1, 0, ShowTypeEnum.EDIT_DETAIL.getCode(), 10000, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 出库发货单编号 serialNo
     */
    SHEET_NO(ContractStockBaseEnum.SHEET_NO.getAttr(), "enum.orderOutstock.attrName.sheet_no", "sheetNo", FieldTypeEnum.SERIALNO.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9990, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 出库日期 date_1
     */
    TIME(ContractStockBaseEnum.TIME.getAttr(), "enum.orderOutstock.attrName.time", "time", FieldTypeEnum.DATETIME.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9980, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 经销商名称 text_66
     */
    LINK_DISTRIBUTOR(ContractStockBaseEnum.LINK_CUSTOMER.getAttr(), "enum.orderOutstock.attrName.link_distributor", "linkDistributor", FieldTypeEnum.LINK_BUSINESS_SINGLE.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9970, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 关联订货单 text_4
     */
    REF_ID(ContractStockBaseEnum.REF_ID.getAttr(), "enum.orderOutstock.attrName.ref_id", "refId", FieldTypeEnum.LINK_BUSINESS_SINGLE.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9960, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 出库仓库 text_2
     */
    WAREHOUSE_ID(ContractStockBaseEnum.WAREHOUSE_ID.getAttr(), "enum.orderOutstock.attrName.warehouse_id", "warehouseId", FieldTypeEnum.LINK_BUSINESS_SINGLE.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9950, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 负责人 ownerId
     */
    MANAGER_ID(ContractStockBaseEnum.MANAGER_ID.getAttr(), "enum.orderOutstock.attrName.manager_id", "managerId", FieldTypeEnum.OWNERID.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9940, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 发货状态 text_70
     */
    EXPRESS_STATUS("text_70", "enum.orderOutstock.attrName.express_status", "expressStatus", FieldTypeEnum.COMBO.getType(), SetTypeEnum.DISABLE_ALL.getCode(), 1, 0, ShowTypeEnum.LIST_DETAIL.getCode(), 9930, 1, 0, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 发货日期 date_2
     */
    SHIP_DATE("date_2", "enum.orderOutstock.attrName.ship_date", "shipDate", FieldTypeEnum.DATETIME.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 1, 0, ShowTypeEnum.LIST_DETAIL.getCode(), 9920, 1, 0, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 产品信息 other_17
     */
    PRODUCT_INFO(ContractStockBaseEnum.PRODUCT_INFO.getAttr(), "enum.orderOutstock.attrName.product_info", "productInfo", FieldTypeEnum.SEPARATOR.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 1, 0, ShowTypeEnum.EDIT_DETAIL.getCode(), 9910, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 出库产品 array_1
     */
    PRODUCT(ContractStockBaseEnum.PRODUCT.getAttr(), "enum.orderOutstock.attrName.product", "products", FieldTypeEnum.SELECT_PRODUCT.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9900, 1, 1, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 产品合计 num_40
     */
    // PRODUCT_TOTAL(ContractStockBaseEnum.PRODUCT_TOTAL.getAttr(), "enum.orderOutstock.attrName.product_total", "productTotal", FieldTypeEnum.NUM.getType(), 3, 1, 0, ShowTypeEnum.ALL.getCode(), 9890, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 其它费用 num_39
     */
    // OTHER_EXPENSE(ContractStockBaseEnum.OTHER_EXPENSE.getAttr(), "enum.orderOutstock.attrName.other_expense", "otherExpense", FieldTypeEnum.NUM.getType(), 3, 1, 0, ShowTypeEnum.ALL.getCode(), 9880, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    // 优惠金额
    DISCOUNT_AMOUNT(ContractStockBaseEnum.DISCOUNT_AMOUNT.getAttr(),"enum.contractOutstock.attrName.discount_amount", "discountAmount", FieldTypeEnum.NUM.getType(), 3, 1, 0, ShowTypeEnum.ALL.getCode(), 9840, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 出库金额 num_38
     */
    TOTAL_MONEY(ContractStockBaseEnum.TOTAL_MONEY.getAttr(), "enum.orderOutstock.attrName.total_money", "totalMoney", FieldTypeEnum.NUM.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9870, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),

    // 物流信息
    EXPRESS_INFO(ContractStockBaseEnum.EXTENSION_INFO.getAttr(), "enum.orderOutstock.attrName.express_info", "expressInfo", FieldTypeEnum.SEPARATOR.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 1, 0, ShowTypeEnum.LIST_DETAIL.getCode(), 9860, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 物流时间 date_3
     */
    EXPRESS_DATE("date_3", "enum.orderOutstock.attrName.express_date", "expressDate", FieldTypeEnum.DATETIME.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 1, 0, ShowTypeEnum.LIST_DETAIL.getCode(), 9850, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 物流公司 text_7
     */
    EXPRESS_NAME(ContractStockBaseEnum.EXPRESS_NAME.getAttr(), "enum.orderOutstock.attrName.express_name", "expressName", FieldTypeEnum.COMBO.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 0, 0, ShowTypeEnum.LIST_DETAIL.getCode(), 9840, 1, 0, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 物流单号 text_8
     */
    EXPRESS_NO(ContractStockBaseEnum.EXPRESS_NO.getAttr(), "enum.orderOutstock.attrName.express_no", "expressNo", FieldTypeEnum.TEXT.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 0, 0, ShowTypeEnum.LIST_DETAIL.getCode(), 9830, 1, 0, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 物流备注 text_17
     */
    EXPRESS_MEMO("text_17", "enum.orderOutstock.attrName.express_memo", "expressMemo", FieldTypeEnum.TEXTAREA.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 0, 0, ShowTypeEnum.LIST_DETAIL.getCode(), 9820, 1, 0, ScreenTypeEnum.SCREEN_SHOW.getType()),
    /**
     * 备注 text_6
     */
    MEMO(ContractStockBaseEnum.MEMO.getAttr(), "enum.orderOutstock.attrName.memo", "memo", FieldTypeEnum.TEXTAREA.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9810, 1, 0, ScreenTypeEnum.SCREEN_SHOW.getType()),

    //收件信息
    RECEIPT_INFO("other_18", "enum.orderOutstock.attrName.receipt_info", "receiptInfo", FieldTypeEnum.SEPARATOR.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9800, 1, 0, ScreenTypeEnum.SCREEN_SHOW.getType()),
    //    RECEIPT_NAME("text_68","enum.orderOutstock.attrName.receipt_name","receiptName", FieldTypeEnum.LINK_RECEIVER.getType(), SetTypeEnum.DISABLE_OPEN.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9980, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 收件人 text_5
     */
    LINK_PARTNER_RECEIVER("text_5", "enum.orderOutstock.attrName.receipt_name", "linkPartnerReceiver", FieldTypeEnum.LINK_RECEIVER.getType(), SetTypeEnum.DISABLE_ALL.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9790, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 收件人电话 text_9
     */
    RECEIPT_PHONE("text_9", "enum.orderOutstock.attrName.receipt_phone", "receiptPhone", FieldTypeEnum.TEXT.getType(), SetTypeEnum.DISABLE_ALL.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9780, 1, 1, ScreenTypeEnum.SCREEN_SHOW.getType()),
    /**
     * 收件地址 address_1
     */
    RECEIPT_ADDRESS("address_1", "enum.orderOutstock.attrName.receipt_address", "receiptAddress", FieldTypeEnum.ADDRESS.getType(), SetTypeEnum.DISABLE_ALL.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9770, 1, 1, ScreenTypeEnum.SCREEN_SHOW.getType()),

    // 寄件信息
    SEND_INFO("other_19", "enum.orderOutstock.attrName.send_info", "sendInfo", FieldTypeEnum.SEPARATOR.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9760, 1, 0, ScreenTypeEnum.SCREEN_SHOW.getType()),
    /**
     * 寄件人 text_69
     */
    SEND_NAME("text_69", "enum.orderOutstock.attrName.send_name", "sendName", FieldTypeEnum.LINK_RECEIVER.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9750, 1, 1, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 联系电话 text_11
     */
    SEND_PHONE("text_11", "enum.orderOutstock.attrName.send_phone", "sendPhone", FieldTypeEnum.TEXT.getType(), SetTypeEnum.DISABLE_ALL.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9740, 1, 1, ScreenTypeEnum.SCREEN_SHOW.getType()),
    /**
     * 地址 address_2
     */
    SEND_ADDRESS("address_2", "enum.orderOutstock.attrName.send_address", "sendAddress", FieldTypeEnum.ADDRESS.getType(), SetTypeEnum.DISABLE_ALL.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9730, 1, 1, ScreenTypeEnum.SCREEN_SHOW.getType()),
    /**
     * 出库金额 num_2
     */
    // OUT_STOCK_AMOUNT("num_2", "enum.orderOutstock.attrName.out_stock_amount", "outStockAmount", FieldTypeEnum.NUM.getType(), SetTypeEnum.DISABLE_ALL.getCode(), 0, 0, ShowTypeEnum.ALL.getCode(), 9720, 1, 1, ScreenTypeEnum.SCREEN_SHOW.getType()),

    // 系统信息
    SYSTEM_INFO(ContractStockBaseEnum.SYSTEM_INFO.getAttr(), "enum.orderOutstock.attrName.system_info", "systemInfo", FieldTypeEnum.SEPARATOR.getType(), SetTypeEnum.DISABLE_REPEAT.getCode(), 1, 0, ShowTypeEnum.EDIT_DETAIL.getCode(), 9710, 1, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 创建人 creatorId
     */
    CREATOR_ID(ContractStockBaseEnum.CREATOR_ID.getAttr(), "enum.orderOutstock.attrName.creator_id", "creatorId", FieldTypeEnum.CREATORID.getType(), 1, 0, 0, ShowTypeEnum.ALL.getCode(), 9700, 1, 0, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 创建时间 addTime
     */
    ADD_TIME(ContractStockBaseEnum.ADD_TIME.getAttr(), "enum.orderOutstock.attrName.add_time", "addTime", FieldTypeEnum.ADDTIME.getType(), 1, 1, 0, ShowTypeEnum.ALL.getCode(), 9690, 1, 0, ScreenTypeEnum.SCREEN_GROUP.getType()),
    /**
     * 更新时间 updateTime
     */
    UPDATE_TIME(ContractStockBaseEnum.UPDATE_TIME.getAttr(), "enum.orderOutstock.attrName.update_time", "updateTime", FieldTypeEnum.UPDATETIME.getType(), 1, 1, 0, ShowTypeEnum.ALL.getCode(), 9680, 1, 0, ScreenTypeEnum.SCREEN_GROUP.getType()),

    // 模板设计界面不需要展示的字段
    /**
     * 出库类型 text_3
     */
    TYPE(ContractStockBaseEnum.TYPE.getAttr(), "enum.orderOutstock.attrName.type", "type", FieldTypeEnum.COMBO.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9670, 1, 1, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 是否出过库 num_1
     */
    OUTBOUND(ContractStockBaseEnum.OUTBOUND.getAttr(), "enum.orderOutstock.attrName.outbound", "outbound", FieldTypeEnum.COMBO_NUM.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9660, 0, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 出库仓库关联显示值 text_10
     */
    WAREHOUSE_ID_LINKED_TEXT(ContractStockBaseEnum.WAREHOUSE_ID_LINKED_TEXT.getAttr(), "enum.orderOutstock.attrName.warehouse_id_linked_text", "warehouseIdLinkedText", FieldTypeEnum.TEXT.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9650, 0, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 关联单据关联显示值 text_12
     */
    REF_ID_LINKED_TEXT(ContractStockBaseEnum.REF_ID_LINKED_TEXT.getAttr(), "enum.orderOutstock.attrName.ref_id_linked_text", "refIdLinkedText", FieldTypeEnum.TEXT.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9640, 0, 0, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 关联经销商隐藏 text_67
     */
    LINK_DISTRIBUTOR_HIDE(ContractStockBaseEnum.LINK_CUSTOMER_HIDE.getAttr(), "enum.orderOutstock.attrName.link_distributor_hide", "linkDistributorHide", FieldTypeEnum.TEXT.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9630, 1, 1, ScreenTypeEnum.SCREEN_OFF.getType()),
    //    LINK_RECEIPT_HIDE("text_86","enum.order.attrName.link_receipt_hide","linkReceiptHide",FieldTypeEnum.TEXT.getType(),1,0,1,ShowTypeEnum.NONE.getCode(),9490,1,1,ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 关联寄件人隐藏 text_87
     */
    LINK_SEND_HIDE("text_87", "enum.orderOutstock.attrName.link_send_hide", "linkSendHide", FieldTypeEnum.TEXT.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9620, 1, 1, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 关联收货人隐藏 text_86
     */
    LINK_PARTNER_RECEIVER_HIDE("text_86", "enum.orderOutstock.attrName.link_partner_receiver_hide", "linkPartnerReceiverHide", FieldTypeEnum.TEXT.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9610, 1, 1, ScreenTypeEnum.SCREEN_OFF.getType()),
    /**
     * 电子面单任务id 用于复打 text_88
     */
    ELECTRONIC_TASK_ID("text_88", "enum.orderOutstock.attrName.electronic_task_id", "electronicTaskId", FieldTypeEnum.TEXT.getType(), 1, 0, 1, ShowTypeEnum.NONE.getCode(), 9610, 1, 1, ScreenTypeEnum.SCREEN_OFF.getType()),

    ;

    /**
     * 英文名称
     */
    private String attr;
    /**
     * 中文名称
     */
    private String attrName;
    /**
     * 对应saas中的attr
     */
    private String saasAttr;
    /**
     * 字段类型，详见
     *
     * @see FieldTypeEnum
     */
    private Integer fieldType;
    /**
     * 重命名、判重、启用必填等权限
     * 1.重命名+字段权限
     * 2.重命名+字段权限+查重
     * 3.重命名+字段权限+启用、必填
     * 4.重命名+字段权限+查重+启用、必填
     * 注：pro中启用和必填是同一个权限，同时启用或同时关闭
     */
    private Integer setType;
    /**
     * 模板设计阶段字段是否允许编辑
     * 1：允许编辑
     * 0：不允许编辑
     */
    private Integer designEditable;
    /**
     * 字段是否显示在模板设计界面
     * 1：不显示
     * 0：显示
     */
    private Integer editHide;
    /**
     * 字段在各个界面（新建、编辑、列表、详情）的展现形式
     * 详见
     *
     * @see ShowTypeEnum
     */
    private Integer showType;
    /**
     * 字段在模板设计界面的排序
     * 建议不要用连续的数字，可以用等差数列，以防以后在两个字段之间加入新字段
     */
    private Integer sort;
    /**
     * 字段在各个界面是否可见(启用)
     * 1：可见
     * 0：不可见
     * 注：字段在具体页面的可见性需要用属性和showType联合判断，在visible=1的情况下判断showType
     */
    private Integer visible;
    /**
     * 字段是否必填
     * 1：必填
     * 0：不必填
     */
    private Integer required;
    /**
     * 筛选类型
     * 1：可筛选
     * 2：不可筛选
     */
    private Integer screenType;

    OrderOutStockEnum(String attr, String attrName, String saasAttr, Integer fieldType, Integer setType, Integer designEditable,
                      Integer editHide, Integer showType, Integer sort, Integer visible, Integer required, Integer screenType) {
        this.attr = attr;
        this.attrName = attrName;
        this.saasAttr = saasAttr;
        this.fieldType = fieldType;
        this.setType = setType;
        this.designEditable = designEditable;
        this.editHide = editHide;
        this.showType = showType;
        this.sort = sort;
        this.visible = visible;
        this.required = required;
        this.screenType = screenType;
    }

    /**
     * 对data内的字段拼上“data.”
     *
     * @param cache
     * @return java.lang.String
     * @author 徐俊杰
     * @date 2019/3/8 9:05
     * @since v1.0
     */
    public static String getAttrConnectData(OrderOutStockEnum cache) {
        return "data." + cache.getAttr();
    }

    /**
     * 获取es查询、聚合字段
     * data在库内是json对象，对data字段内某个key做es【精确查询】时，需要在其前拼上“data.”，且【text等类型的】要在后面拼“.keyword”
     *
     * @param cache 当前枚举对象
     * @return java.lang.String 处理后的聚合字段
     * @author 徐俊杰
     * @date 2019/3/7 10:57
     * @since v1.0
     */
    public static String getEsAttr4Keyword(OrderOutStockEnum cache) {
        FieldTypeEnum fieldTypeEnum = FieldTypeEnum.getFieldTypeEnum(cache.fieldType);
        //字段类型为text，或者字段在es内的类型时text，则需要在后面拼上“.keyword”
        boolean flag = fieldTypeEnum == FieldTypeEnum.TEXT || "text".equals(fieldTypeEnum.getEsalias());
        if (flag) {
            return "data." + cache.getAttr() + ".keyword";
        }
        return "data." + cache.getAttr();
    }

    /**
     * app端详情默认标题显示字段
     *
     * @return List
     * @author GuoJun.HU
     * @date 2019/4/8 19:21
     * @since V1.0
     */
    public static List<Object> getTitleAttrList() {
        return Collections.singletonList(SHEET_NO);
    }

    /**
     * @description: 默认标签
     * @return: java.util.List<java.lang.Object>
     * @creator: jiantao.xiong
     * @date: 2019/12/18 14:47
     */
    public static List<Object> getLabelAttrList() {
        return Collections.singletonList(WAREHOUSE_ID);
    }

    /**
     * 详情默认摘要
     *
     * @author long.rao
     * @date 2019-06-27 15:47
     */
    public static List<Object> getSummaryAttrList() {
        return Arrays.asList(MANAGER_ID, REF_ID, TIME, WAREHOUSE_ID);
    }

    /**
     * 流程中获取隐藏字段
     *
     * @return
     */
    public static List<OrderOutStockEnum> getDisableField() {
        List<OrderOutStockEnum> outstockEnumList = new ArrayList<>();
        for (OrderOutStockEnum outstockEnum : values()) {
            if (Objects.equals(outstockEnum.getShowType(), ShowTypeEnum.NONE.getCode()) || Objects.equals(outstockEnum.getEditHide(), 1)
                    || Objects.equals(outstockEnum.getFieldType(), FieldTypeEnum.CREATORID.getType()) || Objects.equals(outstockEnum.getFieldType(), FieldTypeEnum.ADDTIME.getType())) {
                outstockEnumList.add(outstockEnum);
            }
        }
        return outstockEnumList;
    }

    /**
     * 把传入的字段（类型为LINK_BUSINESS_SINGLE）的转为其隐藏字段
     *
     * @param attr 字段名
     * @return java.lang.String
     * @author zcp
     * @date 2019/7/4 15:31
     * @version v1.0
     * @since v1.0
     */
    public static String changeToHide4Link(String attr) {
        if (Objects.equals(attr, WAREHOUSE_ID.attr)) {
            return WAREHOUSE_ID_LINKED_TEXT.attr;
        } else if (Objects.equals(attr, REF_ID.attr)) {
            return REF_ID_LINKED_TEXT.attr;
        }
        return attr;
    }

    public String getAttrName() {
        return I18nMessageUtil.getMessage(attrName);
    }

    public static String getI18nValue(String value) {
        return I18nMessageUtil.getMessage(value);
    }
}

